package org.example.tinyurl.entity;

import java.io.Serializable;
import java.util.Date;

/**
 * @author: zk
 * @date: 2023/6/19 16:13
 * todo 类名与实体名不对应的时候能用 @TableName注解吗？
 * todo 分库策略和分表策略怎么保证库和表都均衡？
 */
public class TblUrl implements Serializable {

    // id
    private Long id;
    // 短链接
    private String tinyUrl;
    // 长链接
    private String longUrl;
    // 创建时间
    private Date createTime;

    public TblUrl() {
    }

    public TblUrl(Long id, String tinyUrl, String longUrl, Date createTime) {
        this.id = id;
        this.tinyUrl = tinyUrl;
        this.longUrl = longUrl;
        this.createTime = createTime;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTinyUrl() {
        return tinyUrl;
    }

    public void setTinyUrl(String tinyUrl) {
        this.tinyUrl = tinyUrl;
    }

    public String getLongUrl() {
        return longUrl;
    }

    public void setLongUrl(String longUrl) {
        this.longUrl = longUrl;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "TblUrl{" +
                "id=" + id +
                ", tinyUrl='" + tinyUrl + '\'' +
                ", longUrl='" + longUrl + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}
